<?

class debug
{
	protected static $current_ts = null;
	public static $stages = array();
	public static $log = array();

	public static function timer_continue( $stage )
	{
		$prev = self::$current_ts ? self::$current_ts : INIT_TS;
		self::$stages[$stage] = (self::$current_ts = microtime(true)) - $prev;
	}

	public static function log( $cat, $title, $time )
	{
		self::$log[$cat][] = array(
			'title' => $title,
			'time' => $time
		);
	}
}